home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / file_mgt / dir3210 / dir32.txt < prev   
Encoding:
Text File  |  1996-01-03  |  4.2 KB  |  123 lines

  1. 10:41 AM 1/3/96
  2.  
  3. COPYRIGHT RESTRICTION:  THIS PROGRAM MAY NOT BE UPLOADED TO ANY SERVICE OTHER
  4. THAN THE COMPUSERVE INFORMATION SERVICE OR THE MICROSOFT NETWORK.
  5.  
  6. Direct feature requests and tech support ?'s to 72407,243 via CIS MSBASIC, or
  7. RBLevin@msn.com (Internet).
  8.  
  9. =============================================================================
  10.  
  11. To view this document:
  12. (1) Load into Windows Notepad
  13. (2) Maximize Notepad
  14. (3) Make sure Edit+WordWrap is OFF
  15.  
  16. =============================================================================
  17.  
  18. Hasty Documentation for
  19. Rich Levin's Toolkit Objects (TKO)
  20. Dir32 Component
  21. Version 1.0.0
  22.  
  23. PRELIMINARY RELEASE
  24.  
  25. Dir32 has been thoroughly tested and, like all my code, appears to be bug-free.
  26. However, there are a number of extensions contained which have not yet been
  27. enabled.  Future releases will enable these enhancements.
  28.  
  29. Please direct feedback, feature requests, etc., to the author as described
  30. below.
  31.  
  32. Dir32 is for use with Microsoft Visual Basic 4.0 32-bit ONLY.
  33.  
  34. =============================================================================
  35.  
  36. This archive contains the following files:
  37.  
  38. Documentation:    Dir32.txt (this file)
  39. Demo file:    Dir32.exe (run for a demo)
  40. DLL:        Dir32.dll (add to VB4's Tools\References to use)
  41.  
  42. =============================================================================
  43.  
  44. (C) 1995 RBLevin
  45. All Rights Reserved
  46.  
  47. LCI
  48. PO Box 14546
  49. Phila., PA 19115
  50.  
  51. 215-887-8281 (voice)
  52. 215-887-5485 (fax)
  53.  
  54. RBLevin@msn.com
  55. 72407.243@compuserve.com
  56.  
  57. Rich Levin is the producer of KYW NewsRadio's PC Report (Phila.), and a
  58. contributing editor to Windows Magazine (CMP).
  59.  
  60. =============================================================================
  61.  
  62. Dir32 was developed to help CompuServe MSBASIC members.  At least once a week,
  63. questions such as "How can I create an XCOPY command in VB?", or "How can I
  64. scan the hard disk and find all the .INI files?" are posted.
  65.  
  66. I developed Dir32 to satisfy these requests.  Dir32 operates like DOS' DIR
  67. command.  You give it a filespec; it returns an array that contains a list of
  68. every matching file.  You use Dir32 much as you would a VB OCX.  Set a few
  69. properties, call a method, and you're off.  A code example appears below.
  70.  
  71. To install Dir32:
  72.     (1) Copy Dir32.dll to your \Windows\System folder.
  73.     (2) Load VB4, and your project.
  74.     (3) Click Tools\References.
  75.     (4) Scroll through the list until you find Dir32.
  76.     (5) Select Dir32.
  77.     (6) Paste the code sample below.
  78.     (7) Compile and run.
  79.  
  80. Any error will raise an Err.Number 9500.  Verbose error messages and suggested
  81. solutions are returned in Err.Description.
  82.  
  83. =============================================================================
  84.  
  85. Sub DemoDirectoryObject()
  86. 'Demonstration of RBL's Dir32 class
  87.  
  88.     'Properties:
  89.     '    Drive           -- Drive to search (required)
  90.     '    Folder          -- Starting path (required)
  91.     '    Filespec        -- Any valid Win95 filespec (required)
  92.     '    ShowFolder      -- True adds d:\folder\ to filename.ext (Default=F)
  93.     '    ShowSubfolders  -- True causes subfolders to be searched (Default=F)
  94.     '    FilesCount      -- Returns number of files that meet filespec (RO)
  95.  
  96.     'Method:
  97.     '    Files           -- Returns array of filenames
  98.  
  99.     Dim Directory as New clsDirectory   'Create new Directory object*
  100.     Dim Files As Variant                'DIR array passed here
  101.     Dim I as Long                       'For/Next loop Index
  102.   
  103.     Directory.Drive = "C:"          'Set drive (required)
  104.     Directory.Folder = "\Windows"   'Set starting path (required)
  105.     Directory.Filespec = "*.INI"    'Set search filespec (required)
  106.     Directory.ShowFolder = True     'Attach folder names (optional)
  107.     Directory.ShowSubfolders = True 'Search subfolders, too (optional)
  108.     
  109.     'Use Files method; pass array of filenames to Files
  110.     Files = Directory.Files
  111.  
  112.    'Show the files found using the read-only Directory.FilesCount property
  113.     For I = 1 to Directory.FilesCount
  114.         Debug.Print Files(I)
  115.     Next I
  116.  
  117.     '*Dim the new object in [Declarations] and it will be global to the module.
  118.  
  119. End Sub
  120.  
  121. =============================================================================
  122.                     ###
  123.